#ifndef EMAIL_SENDER_H
#define EMAIL_SENDER_H
#include "SingleClass.h"
#include <string>
#include <iostream>
#include <Poco/Net/MailMessage.h>
#include <Poco/Net/SMTPClientSession.h>
#include <Poco/Net/SecureSMTPClientSession.h>
#include <Poco/Net/NetException.h>
#define SMTP_SERVER "smtp.163.com"
#define SMTP_PORT 25
#define SENDER "here_is_ling@163.com"
#define AUTH_CODE "NNQ9FXkcY7EQmuB3"

class email_sender:public SingleClass<email_sender>{

public:
    ~email_sender();
    bool send_email_plain_text(const std::string  &recipient,const std::string & subject,const std::string& content);
private:
    friend SingleClass<email_sender>;
    email_sender();
    Poco::Net::SecureSMTPClientSession * smtp;
    bool is_connected;
    // std::string smtp_server;    //对应邮箱的服务器
    // int port;   //对应的port
    // std::string sender; //发送者邮箱
    // std::string auth_code;  //授权码


};




#endif